//
//  ZJSSwitchControl.h
//  ZJS
//
//  Created by qingqiu.yuan on 16/9/12.
//  Copyright © 2016年 zall. All rights reserved.
//

#import "ZallBaseView.h"

typedef NS_ENUM(NSUInteger, ZJSSwitchDirection) {
    ZJSSwitchLeft = 0,//发货界面
    ZJSSwitchRight, //收货界面
};

@protocol ZJSSwitchControlDelegate <NSObject>
@optional

/*
 * 切换到哪一边
 */
-(void)switchState:(UIView *)view direction:(ZJSSwitchDirection)direction;

@end

@interface ZJSSwitchControl : ZallBaseView

/**
 *  @brief  滑块颜色
 */
@property (copy, nonatomic) UIColor *scrolViewColor;

@property (nonatomic,weak) id <ZJSSwitchControlDelegate> delegate;//切换代理

/**
 *  自定义初始化方法
 *
 *  @param frame      位置
 *  @param leftTitle  左侧标题
 *  @param rightTitle 右侧标题
 *
 */
- (id)initWithFrame:(CGRect)frame leftTtitle:(NSString *)leftTitle rightTitle:(NSString *)rightTitle;
/**
 *  获取当前选择的Tab
 *
 *  @return ZJSSwitchDirection
 */
- (ZJSSwitchDirection)getCurrentDirection;

/**
 *  设置选择的Tab
 *
 *  @param direction ZJSSwitchDirection
 */
- (void)setSelectedSwitch:(ZJSSwitchDirection)direction;

/**
 *  @brief  滑动带有动画效果
 */
- (void)setCurrentOffset:(CGPoint)offset animated:(BOOL)animated;

/**
 *  @brief  选中带有动画效果
 */
- (void)setSelectedItemIndex:(NSInteger)index animated:(BOOL)animated;
@end
